package com.lanou3g.practice;

import java.io.*;
import java.net.Socket;

/**
 * Created by dllo on 18/4/24.
 */
public class EchoThread extends Thread {

    private Socket client;

    public EchoThread(Socket client) {
        this.client = client;
    }

    @Override
    public void run() {
        PrintWriter pw = null;
        BufferedReader br = null;

        try {
            br = new BufferedReader(new InputStreamReader(client.getInputStream()));
            pw = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
            String s = "";
            while ((s = br.readLine()) != null){
                String ss = "ecdf"+s;
                pw.println(ss);
                pw.flush();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally {

        }




    }
}
